from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext

from t_ch.models import Technology

def index(request, template_name="t_ch/index.html"):
    """
    The technologies used
    """
    technologies = Technology.objects.all()
    return render_to_response(template_name, {'technologies':technologies, 'nav_page':'pr_j_technology_index'},
                              context_instance=RequestContext(request))

def technology(request, slug, template_name="t_ch/technology.html"):
    """
    A technology used
    """
    technology = get_object_or_404(Technology, slug=slug)
    return render_to_response(template_name, {'technology':technology,},
                              context_instance=RequestContext(request))
    